package net.oschina.zbus;

import org.zbus.common.Helper;
import org.zbus.server.ZbusServer;

/**
 * 直接本地启动zbus，参数控制部分
 * @author 洪磊明(rushmore)
 *
 */
public class ZbusStarter { 
	
	//透明式直接启动zbus
	public static void main2(String[] args) throws Exception{
		ZbusServer.main(args);
	}
	
	//个性化控制启动
	public static void main(String[] args) throws Exception { 
		int serverPort = Helper.option(args, "-p", 15555); 
		String adminToken = Helper.option(args, "-admin", "");
		String trackServerAddr = Helper.option(args, "-track", "127.0.0.1:16666;127.0.0.1:16667");
		String storeType = Helper.option(args, "-store", "dummy");  
		
		ZbusServer zbus = new ZbusServer(serverPort);  
		zbus.setAdminToken(adminToken);
		zbus.setMessageStoreType(storeType);
		zbus.setupTrackServer(trackServerAddr); 
		zbus.start();
	}
}
